package com.druid;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration;
import org.springframework.context.ApplicationContext;

//排除掉SpringBoot默认提供的数据源
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class, DataSourceTransactionManagerAutoConfiguration.class})
public class DruidApplication {

    public static void main(String[] args) {
        try {
            System.out.println("druid start!");
            ApplicationContext applicationContext = SpringApplication.run(DruidApplication.class, args);
            applicationContext.getBean(MergeService.class).merge(1000);
            System.out.println("druid end!");
        } catch (Exception e) {
            System.err.println(e);
        }
    }
}
